<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="http://www.baidu.com;" onclick="abc()">百度</a>
    <form action="aaa">
        <input type="submit" onclick="abc();" />
    </form>
    <script>
        function abc() {
            // 阻止浏览器默认事件
            event.preventDefault()
        }
        function bcd() {
            alert("outer")
        }
        function efg() {
            // 阻止事件的冒泡 
            event.stopPropagation()
            alert("inner")
        }
    </script>

    <div onclick="bcd()">
        1
        <div onclick="efg()">
            2
        </div>  
        3
    </div>



    <script>

        // function abc(a) {
        //     a()
        // }
        // // var temp = function(){alert(1)}
        // // abc(temp)

        // abc(() => alert(1))

        var n = [3, 1, 5, 2, 7]
        n.sort((a,b) => b - a);
        n.forEach(item => console.info(item))
        // n.sort(function(a, b) { return b - a})
        // n.forEach(function(item){
        //     console.info(item)
        // })
        console.info("-------------------")

        var m = [10, 12, 9, ...n]
        m.forEach(item => console.info(item))

        var n = {"ename": "tom"}
        var m = {"age":10, ...n}
        console.info(m)
        
    </script>
</body>
</html>